package com.xuecheng.api.teaching;


import com.xuecheng.api.comment.model.dto.CommentDTO;
import com.xuecheng.api.comment.model.dto.CommentReplyDTO;
import com.xuecheng.api.comment.model.qo.CommentConditionModel;
import com.xuecheng.api.comment.model.vo.CommentStatisticsVo;
import com.xuecheng.api.teaching.model.CompanyDTO;
import com.xuecheng.common.domain.page.PageRequestParams;
import com.xuecheng.common.domain.page.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;

@Api(value = "教学机构管理")
public interface CompanyApi {

    @ApiOperation("评论列表-用户")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "params", value = "租户id", required = true, example = "1", dataType = "PageRequestParams", paramType = "query"),
            @ApiImplicitParam(name = "commentModel", value = "租户id", required = true, example = "1", dataType = "CommentConditionModel", paramType = "body")
    })
    PageVO<CommentDTO> commentList(PageRequestParams params, @Valid @RequestBody CommentConditionModel commentModel);


    @ApiOperation("评论列表-机构")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "params", value = "租户id", required = true, example = "1", dataType = "PageRequestParams", paramType = "query"),
            @ApiImplicitParam(name = "commentModel", value = "租户id", required = true, example = "1", dataType = "CommentConditionModel", paramType = "body")
    })
    PageVO<CommentDTO> commentList4c(PageRequestParams params, @Valid @RequestBody CommentConditionModel commentModel);


    @ApiOperation(value = "根据租户id获取教学机构信息", hidden = true)
    @ApiImplicitParam(name = "tenantId", value = "租户id", required = true, example = "1", dataType = "Long", paramType = "path")
    CompanyDTO getByTenantId(@PathVariable("tenantId") Long tenantId);

//    @ApiOperation("批量删除评论")
//    Boolean batchDelComment(Long commentId, Long[] commentIds);

    @PostMapping("发表评论")
    CommentDTO comment(@Valid @RequestBody CommentDTO commentDTO);


    @ApiOperation("统计-评论数,平均分")
    @ApiImplicitParam(name = "coursePubId", value = "课程发布id", required = true, example = "1", dataType = "Long", paramType = "path")
    CommentStatisticsVo getStatistics(@PathVariable Long coursePubId);

    @ApiOperation("回复评论")
    CommentReplyDTO commentReply(CommentReplyDTO dto);

    @ApiOperation("删除评论")
    Boolean deleteComment(Long commentId);

    @ApiOperation("点赞")
    Boolean praise(Long commentId);

    @ApiOperation("根据id查询机构详情")
    CompanyDTO getCompanyById(Long companyId);

    @ApiOperation("查询我的机构详情")
    CompanyDTO getMyCompany();

}
